package com.linewell.commom.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.linewell.system.model.SysCustomer;

/**
 * 客户评价表实体类 对应数据库表：CUST_JUDGE
 * 
 * @author 蔡鹭佳  时间：2016/9/18
 */
@Entity
@Table(name = "CUST_JUDGE")
@DynamicInsert(true)
@DynamicUpdate(true)
public class CustJudge implements Serializable {

	private static final long serialVersionUID = -2309924984153253518L;

	// ID，COMMODITY_IDS，CUST_ID，STAR，REMARK，STATUS

	private Integer id; // 编号
	private Integer commodityId; // 商品编号
	// private CommodityInfo commodityInfo;
	private SysCustomer customer;// 评价人
	private Long orderId; // 订单编号
	private Integer star; // 星级：1好评2中评3差评
	private String remark; // 评语
	private Byte status; // 状态：9正常0禁用
	private Date createTime;   //创建时间

	

	@Id
	@Column(name = "ID", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO) // 自增长
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name = "COMMODITY_ID", nullable = false)
	public Integer getCommodityId() {
		return commodityId;
	}

	public void setCommodityId(Integer commodityId) {
		this.commodityId = commodityId;
	}

	@ManyToOne(targetEntity = SysCustomer.class)
	@JoinColumn(name = "CUST_ID", referencedColumnName = "CUST_ID") // 非主键关联
	public SysCustomer getCustomer() {
		return customer;
	}

	public void setCustomer(SysCustomer customer) {
		this.customer = customer;
	}

	@Column(name = "ORDER_ID", nullable = false)
	public Long getOrderId() {
		return orderId;
	}

	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}

	@Column(name = "STAR", nullable = false)
	public Integer getStar() {
		return star;
	}

	public void setStar(Integer star) {
		this.star = star;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "STATUS", columnDefinition = "tinyint default 9")
	public Byte getStatus() {
		return status;
	}

	public void setStatus(Byte status) {
		this.status = status;
	}
	@Column(name = "CREATE_TIME",columnDefinition = "timestamp not null default CURRENT_TIMESTAMP")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

}
